import request from '@/utils/request'

// 勘探任务分配列表20210923
export function listExplorationNoPermission(query) {
  return request({
    url: '/supervise/explorationApi/listNoPermission',
    method: 'post',
    params: query
  })
}

// 勘探点列表
export function listExploration(query) {
  return request({
    url: '/supervise/explorationApi/list',
    method: 'post',
    params: query
  })
}

// 删除勘探点
export function deleteExploration(id) {
  return request({
    url: '/supervise/explorationApi/remove',
    method: 'post',
    params: { id }
  })
}
// 查询勘探点无权限
export function listNoExploration(query) {
  return request({
    url: '/supervise/explorationApi/listNoPermission',
    method: 'post',
    params: query
  })
}

// 新增勘探点
export function addExploration(data) {
  return request({
    url: '/supervise/explorationApi/add',
    method: 'post',
    data: data
  })
}

// 更新勘探点
export function updateExploration(data) {
  return request({
    url: '/supervise/explorationApi/update',
    method: 'post',
    data: data
  })
}

// 勘探点详情
export function getExplorationById(id) {
  return request({
    url: '/supervise/explorationApi/get/' + id
  })
}

// 现场照片
export function getSitePhoto(proId) {
  return request({
    url: '/supervise/sitePhotoApi/get/' + proId
  })
}
// 外业数据采集
export function getOutside(params) {
  return request({
    url: '/supervise/explorationOutsideApi/list',
    method: 'post',
    params
  })
}

// 静探报告解析
export function getFileDataList(id) {
  return request({
    url: '/supervise/staticTestApi/getStaticTestInfo/' + id
  })
}

// 静探报告保存
export function addStaticProbe(data) {
  return request({
    url: '/supervise/staticTestApi/batchAdd',
    method: 'post',
    data
  })
}

// 静探报告详情
export function detailStaticProbe(id) {
  return request({
    url: '/supervise/AppFileControllerApi/get/' + id
  })
}

// 导入勘探点
export function explorationImportData(proId, data) {
  return request({
    url: '/supervise/explorationApi/importData/' + proId,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 下载模板
export function getExplorationExcelTemplate() {
  return request({
    url: '/supervise/explorationApi/getExcelTemplate',
    responseType: 'blob' // 表明返回服务器返回的数据类型
  })
}

// 获取勘探点是否确认的状态
export function selectExplorationStatusByUserId(params) {
  return request({
    url: '/supervise/proUserExplorationApi/selectExplorationStatusByUserId',
    method: 'post',
    params
  })
}
